<include file="Public:header" />

<div class="autobox">
	<div class="now">
		<i class="fa fa-home fa-lg move mr5"></i>
		<a href="/" class="">首页 </a> &gt; 
		<a href="/user/index.html" class="">安全中心 </a> &gt;交易密码	
		</div>
	<div class="main-content">
		<style>
	.nav-tab-list .nav-tab-hover{
		width:100%;
		top:60px;
		height:50px;
		line-height:50px;
		background:#EAEDF4;
		position:absolute;
		box-sizing:content-box;
		z-index:1;
		transition:all 0.5s;
		-webkit-transition:all 0.5s;
		display:none;
	}
</style>
<script type="text/javascript">
	$(function () {
		(function () {
			var tab   = $('.nav-tab-list dd');
			var hover = $('.nav-tab-hover');
			var pos   = 0;
			tab.each(function (index) {
				var $this = $(this);
				if ($this.hasClass('active')) {
					pos = index;
				}
				$this.hover(function () {
					_moveTo(index);
				}, function () {
					_moveTo(pos);
				});
			});
			_moveTo(pos);
			$('.nav-tab-hover').show();
			function _moveTo(index) {
				hover.css("top", 60 + 50 * index);
				tab.removeClass('active');
				tab.eq(index).addClass('active');
			}
		})();
	});
	$(window).on('scroll resize', function () {
		if (document.body.scrollTop < 100) {
			$('#left-nav-bar').css("top", 0);
		} else if (document.body.scrollTop > ($('.tag-list-content').height() - $('#left-nav-bar').height() + 100)) {
			$('#left-nav-bar').css("top", ($('.tag-list-content').height() - $('#left-nav-bar').height()));
		} else {
			$('#left-nav-bar').css("top", document.body.scrollTop - 100);
		}
	});
</script>

<include file="User:left" />




		<div class="tag-list-content assets_content bg_w">
			<div class="safe_center clear">
				<h1>
					<span>
						交易密码					</span>
                    <span>
                        <a onclick="step1();" id="step1" class="step fz_12 ml50 pd6 active">修改交易密码</a>
                        <a onclick="step2();" id="step2" class="step fz_12 ml20 pd6">设置验证方式</a>
                    </span>
					<span>
												<a class="right" onclick="$('#hints').slideToggle();"><i class="fa fa-hand-o-right fz_14 mr5 move"></i><span class="fz_12 move">查看介绍</span></a>
											</span>
				</h1>
			</div>
			<div id="hints" class="mytips" style="display:none;">
				
				<notempty name="prompt_text">
					<p>{$prompt_text}</p>		
				</notempty>			
				
				
				
				</div>
			<div class="mytable-body  ">
				<div class="step1 pwtrade">
					<dl>
						<dt></dt>
						<dd class="band_succ move">
							<i class="fa fa-check mr5"></i>请定期更新交易密码						</dd>
					</dl>
					<dl>
						<dt>旧交易密码：</dt>
						<dd>
							<input type="password" tabindex="1" id="oldpaypassword" class="texts"><a href="/Findpwd/findpwd" class="move ml5">忘记?</a>
						</dd>
					</dl>
					<dl>
						<dt>新交易密码：</dt>
						<dd>
							<input type="password" tabindex="2" id="newpaypassword" class="texts">
						</dd>
					</dl>
					<dl>
						<dt>确认密码：</dt>
						<dd>
							<input type="password" tabindex="3" id="repaypassword" class="texts">
						</dd>
					</dl>
					<dl>
						<dt></dt>
						<dd>
							<input type="button" tabindex="4" class="btns2" value="保存" onclick="paypassword_up()">
						</dd>
					</dl>
					
				</div>
				<div class="step2 set_verify mt30" style="display:none;">
					<ul>
						<li>配置验证方式:</li>
						<li>
							<input type="radio" name="tpwdsetting" value="1" style="vertical-align: -2px;"
							<eq name="user['tpwdsetting']" value="1">checked="checked"</eq>
							> 每次登录只输入一次交易密码						</li>
						<li>
							<input type="radio" name="tpwdsetting" value="2" style="vertical-align: -2px;"
							<eq name="user['tpwdsetting']" value="2">checked="checked"</eq>
							> 每笔交易都输入交易密码						</li>
						<li>
							<input type="radio" name="tpwdsetting" value="3" style="vertical-align: -2px;"
							<eq name="user['tpwdsetting']" value="3">checked="checked"</eq>
							> 每次交易都不需要输入交易密码						</li>
						<li>
							<div class="mt5 mb5 ">
								<input id="paypassword" placeholder="请输入交易密码" type="password" class="texts"><a href="/Findpwd/findpwd" class="move ml5">忘记?</a>
							</div>
						</li>
						<li>
							<div class="mt10 mb10 ">
								<input class="btns2" value="保存" type="button" onclick="paypassword_set()">
							</div>
						</li>
					</ul>
					
				</div>
			</div>
		</div>
	</div>
</div>



<script>
						function step1() {
							$(".step").removeClass('active');
							$('#step1').addClass('active');
							$(".step2").hide();
							$(".step1").show();
						}
						function paypassword_up() {
							var oldpaypassword = $('#oldpaypassword').val();
							var newpaypassword = $('#newpaypassword').val();
							var repaypassword  = $('#repaypassword').val();
							alert(repaypassword);
							if (oldpaypassword == '' || oldpaypassword == null) {
								layer.tips("请输入旧交易密码", '#oldpaypassword', {tips: 3});
								return false;
							}
							if (newpaypassword == '' || newpaypassword == null) {
								layer.tips("请输入新交易密码", '#newpaypassword', {tips: 3});
								return false;
							}
							if (repaypassword == '' || repaypassword != newpaypassword) {
								layer.tips("请正确输入确认密码", '#repaypassword', {tips: 3});
								return false;
							}

							$.post("/user/uppaypassword_qq.html", {
								oldpaypassword: oldpaypassword,
								newpaypassword: newpaypassword,
								repaypassword : repaypassword,
								type:1
							}, function (data) {
								if (data.status == 1) {
									layer.msg(data.info, {icon: 1});
									if (data.url) {
										window.location = data.url;
									} else {
										window.location.reload();
									}
								} else {
									layer.msg(data.info, {icon: 2});
									if (data.url) {
										window.location = data.url;
									}
								}
							}, "json");
						}
					</script>
<script>
						//$(':radio[name="tpwdsetting"]').eq(("2" - 1)).attr("checked", true);

						function step2() {
							$(".step").removeClass('active');
							$('#step2').addClass('active');
							$(".step1").hide();
							$(".step2").show();
						}

						function paypassword_set() {
							var paypassword = $("#paypassword").val();
							var tpwdsetting = $("input[name='tpwdsetting']:checked").val();
							if (paypassword == "" || paypassword == null) {
								layer.tips("请输入交易密码", '#paypassword', {tips: 3});
								return false;
							}
							if (tpwdsetting == "" || tpwdsetting == null) {
								layer.tips("请选择一个", '#tpwdsetting', {tips: 3});
								return false;
							}

							$.post("/user/uptpwdsetting.html", {
								paypassword: paypassword,
								tpwdsetting: tpwdsetting,
								type:2

							}, function (data) {
								if (data.status == 1) {
									layer.msg(data.info, {icon: 1});
									if (data.url) {
										window.location = data.url;
									} else {
										window.location.reload();
									}
								} else {
									layer.msg(data.info, {icon: 2});
									if (data.url) {
										window.location = data.url;
									}
								}
							}, "json");
						}
					</script>
<script>
	$('.user_paypassword').addClass('active');
</script>












<script>
	var hints = "0";
	if(hints == 1){
		$('#hints').show();
	}
</script>

<script>
	if ($("#user_box").length > 0) {
		$('#user_box').addClass('active');
	} else {
		$('#index_box').addClass('active');
	}
</script>
<script>
	$('.finan_index').addClass('active');
</script>












<include file="Public:footer" />